# -*- coding: utf-8 -*-
"""
Created on Mon Dec  2 17:21:59 2013
This file is used for analyzing whether there are users who add and remove the
game in a single month.
@author: xiehanting
"""

"""
Import packages
"""
import csv;

"""
Load files
"""
apaReader = csv.reader(open('/Users/xiehanting/Documents/SkyDrive/Documents\
/Important/PHD Research/WE R/Kontagent Data/January Kontagent Data/apa 201201.csv','rb'));
aprReader = csv.reader(open('/Users/xiehanting/Documents/SkyDrive/Documents\
/Important/PHD Research/WE R/Kontagent Data/January Kontagent Data/apr 201201.csv','rb'));

"""
Skip the title line
"""
next(apaReader);
next(aprReader);

"""
Process from here
"""
same = [];  #used for storing same user ids
for item_apa in apaReader:
    u1 = item_apa[2];
    for item_apr in aprReader:
        u2=item_apr[2];
        if u1==u2:  #comparison of user ids in both data base
            same.append(u1);
if not same:
    print("No same users found!");
else:
    for item_same in same:
        print item_same;